package com.demo.house.controller;

import com.demo.house.common.Result;
import com.demo.house.service.HouseUrlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RequestMapping(value = "/HouseUrl")
@RestController
public class HouseUrlController {
    @Autowired
    private HouseUrlService houseUrlService;
/*查询房源图片表*/
    @GetMapping("selectBll")
    public Result selectBll(){
        return Result.getSuccess().setData(houseUrlService.selectBll());
    }
    /*根据id查图片*/
    @GetMapping("/selectUlr2/{id}")
    public Result selectUlr2(@PathVariable Integer id){
        return Result.getSuccess().setData(houseUrlService.selectUrl2(id));
    }
    /*上传图片*/
    @PostMapping(value = "/up")
    public Result up(MultipartFile file,@RequestParam("id") Integer id){
        return Result.getSuccess().setData(houseUrlService.up(id,file));
    }

}
